#!/bin/bash 

## @file pasarUTF8
## 
## @brief Pasar archivos a utf-8
##
## dependencias: vi
##
## Opciones:
## <pre>
## --help | -h              Pantalla de ayuda
## </pre>
##
## @author   Eduardo Magrané
##
## @internal
##
##       web  http://www.mamedu.com
##
##      mail  eduardo.mamedu.com
##
##  Revision  SVN $Id: $
##
## Copyright  Copyright (c) 2011, Eduardo Magrané
## 
## This source code is released for free distribution under the terms of the
## GNU General Public License as published by the Free Software Foundation.

## Mostrar ayuda

function help() {

   local -i count=0
   while read linea ; do 
      let count++
      if [ $count -gt 2 ] ; then
         [ "$linea" = "" ] && return
         echo "$linea" | sed 's/^##//' | sed 's/@brief //' | sed 's/@file //' 
      fi
   done < "$0"
   echo

   }


if [ "$1" == "-h" ] || [ "$1" == "--help" ] ; then

   help
   exit

fi

for f in $*
do
echo $f
vi -c "wq! ++enc=utf8" $f
done

